 package com.cxl.pattern.memento;
 
 import java.io.PrintStream;
 
 public class Originator
 {
   private int state = 90;
 
   private Caretaker c = new Caretaker();
 
   public void createMemento()
   {
    // this.c.saveMemento(new Memento(this.state, null));
   }
 
   public void modifyStateTest(int m)
   {
     this.state = m;
     System.out.println("the state is " + this.state);
   }
 
   public void setMemento()
   {
     Memento memento = (Memento)this.c.getMemento();
     this.state = memento.getState();
     System.out.println("the state is " + this.state);
   }
 
   private class Memento
     implements MementoIF
   {
     private int state;
 
     private Memento(int state)
     {
       this.state = state;
     }
     private int getState() {
       return this.state;
     }
   }
 }

/* Location:           E:\work\eclipse3.6_\workspace\design_pattern\
 * Qualified Name:     com.cxl.pattern.memento.Originator
 * JD-Core Version:    0.6.1
 */